/**************手机端rem尺寸算法  ****************/
var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
var htmlDom = document.getElementsByTagName("html")[0];
htmlDom.style.fontSize = htmlWidth/ 10 +"px";


/**********蘑菇街轮播图**********/
//获取变量
var $1_lb = document.getElementById("lunbo");
var $1_imgs = $1_lb.getElementsByTagName("img");
var $1_ul = $1_lb.getElementsByTagName("ul")[0];
var $1_index = 0, $_id;
showlogo();
var $1_ul_li = $1_ul.getElementsByTagName("li");
interval();

//轮播图函数
function interval() {
    $_id = setInterval(function () {
        hidden();
        $1_index++;
        if ($1_index == $1_imgs.length) {
            $1_index = 0;
        }
        display();
    }, 1000);
}
//给ul动态添加li标签
function showlogo() {
    let $1_ul = $1_lb.getElementsByTagName("ul")[0];
    let html = "";
    for (let i = 0; i < $1_imgs.length; i++) {
        if (i == $1_index) {
            html = html + "<li class =\"img_li_color\"></li>";
        } else {
            html = html + "<li></li>";
        }
    }
    $1_ul.innerHTML = html;
}
//给li标签动态添加属性
function hidden() {
    $1_ul_li[$1_index].removeAttribute("class");
    $1_imgs[$1_index].removeAttribute("class");
}
function display() {
    $1_ul_li[$1_index].className = "img_li_color";
    $1_imgs[$1_index].className = "on_img";
}
